define(['jquery', 'libs/x2js'], function($, x2js) {
	'use strict';

	return function(xmlUrl, setModel) {
		$.ajax({
			url: xmlUrl,
			type: 'GET',
			dataType: 'text',		//注意此处需要设置text！
			Timeout: 1000,
			error: function(xmlData) {
				console.log("加载失败！");
			},
			success: function(xmlData) {
				console.log("加载成功！");
				var x2js = new X2JS();
				var jsonData = x2js.xml_str2json(xmlData);
				setModel(jsonData);
			}
		});
	}
});